home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-16 | 1.0 KB | 37 lines | [TEXT/CWIE] |
- // Sprocket Framework header file
- // SprocketMacros.h
-
-
- #if qDebug
-
- #if GENERATINGPOWERPC
- #define DebugMessage(x) DebugStr(x)
- #else
- #define DebugMessage(x) SysBreakStr(x)
- #endif
-
- #if GENERATINGPOWERPC
- inline void DebugNum(long x) {Str255 s; NumToString(x, s); DebugStr(s);}
- #else
- inline void DebugNum(long x) {Str255 s; NumToString(x, s); SysBreakStr(s);}
- #endif
-
- #else
-
- #define DebugMessage(x)
- #define DebugNum(x)
-
- #endif
-
- inline void FailErr(OSErr theErr) { if(theErr != noErr) throw(theErr); }
- inline void FailOSErr(OSErr theErr) { FailErr(theErr); }
- inline void FailResError() { FailErr(ResError()); }
- inline void FailMemError() { FailErr(MemError()); }
- inline void FailNil(void* ptr) { if(ptr == nil) throw(nilHandleErr); }
- inline void FailResErrorOrNil(void* ptr) { FailResError(); FailNil(ptr); }
- inline void FailMemErrorOrNil(void* ptr) { FailMemError(); FailNil(ptr); }
-
-
- inline Point TopLeft( Rect& r ) { return *(Point *) &(r).top; }
- inline Point BotRight( Rect& r ) { return *(Point *) &(r).bottom; }
-